#define ElemType int

typedef struct ListNode List_Node;

#include "common.h"

int distributeCandies(int* candyType, int candyTypeSize);
int distributeCandies2(int* candyType, int candyTypeSize);

int main()
{
	return 0;
}

int distributeCandies(int* candyType, int candyTypeSize)
{
	int type = 0;
	char aux[200020] = { 0 };
	for (int i = 0; i < candyTypeSize; i++)
		if (!aux[candyType[i] + 100000]) {
			type++;
			aux[candyType[i] + 100000] = 1;
		}

	int mid = candyTypeSize >> 1;
	return type > mid ? mid : type;
}

int distributeCandies2(int* candyType, int candyTypeSize)
{
	int type = 0;
	char aux[200020 >> 3] = { 0 };
	for (int i = 0; i < candyTypeSize; i++) {
		int bias = candyType[i] + 100000;
		if (!(aux[bias >> 3] & 0x80 >> (bias & 0x7))) {
			type++;
			aux[bias >> 3] |= (0x80 >> (bias & 0x7));
		}
	}
	int mid = candyTypeSize >> 1;
	return type > mid ? mid : type;
}
